package com.baizhi.controller;

import com.baizhi.annotation.LogAnnotation;
import com.baizhi.entity.CmfzLog;
import com.baizhi.service.CmfzLogService;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

@RequestMapping("log")
@RestController
public class CmfzLogController {
    @Autowired
    private CmfzLogService cmfzLogService;
    @RequestMapping("selectAllLog")
    @ResponseBody
    @LogAnnotation(content = "查询所有日志信息",type = "查询")
    public Map selectAllLog(Integer page,Integer limit,String type){
        HashMap map = new HashMap();
        Page<CmfzLog> cmfzLogPage = cmfzLogService.selectAll(page, limit, type);
        map.put("code",0);
        map.put("msg","");
        map.put("count",cmfzLogPage.getTotal());
        map.put("data",cmfzLogPage.getRecords());
        return map;
    }
}
